<template>
  <div class="app-container">
    <nav>
      <router-link to="/">首页</router-link> |
      <router-link to="/table">表格页面</router-link>
    </nav>
    <router-view></router-view>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
import { onMounted } from "vue";
const router = useRouter();

// 监听路由处理
onMounted(() => {
  const props = window.$wujie?.props; // {data: xxx, methods: xxx}
  console.log(props, "props");
  if (props) {
    console.log("Navigating to:", props.path);
    router.push({
      path: props.path
    });
  }
});
</script>

<style>
.app-container {
  padding: 20px;
}

nav {
  padding: 20px 0;
  margin-bottom: 20px;
}

nav a {
  color: #2c3e50;
  text-decoration: none;
  margin: 0 10px;
}

nav a.router-link-active {
  color: #42b983;
  font-weight: bold;
}
</style>
